a = [('张三', 1001),
     ('李四', 1002),
     ('王五', 1003),
     ('陈六', 1004)]
for name ,sid in a:
    if name == '王五':
        print((name,sid))
def find_by_name(table,name):
     for name1,sid in table:
         if name1 == name:
             print((name1,sid))

find_by_name(a,'张三')